fix: resolve test failures on macOS#3304
Conversation
- docker-manager-utils: Read actual root home from /etc/passwd instead of hardcoding /root (macOS uses /var/root) - docker-manager-cleanup: Mock getSafeHostUid/Gid to use real uid/gid so chownSync doesn't fail with EPERM on macOS (gid 501 gets clamped to 1000, which the current user can't chown to) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes macOS-specific test failures by reading root's actual home directory from /etc/passwd instead of hardcoding /root, and by mocking getSafeHostUid/Gid in cleanup tests to avoid the clamping-to-1000 EPERM issue.
Changes:
- Dynamically resolve root's home directory in
docker-manager-utils.test.tsto support both/root(Linux) and/var/root(macOS). - Mock
host-envindocker-manager-cleanup.test.tssochownSyncuses the real process uid/gid.
Show a summary per file
| File | Description |
|---|---|
| src/docker-manager-utils.test.ts | Reads root home from /etc/passwd at test time instead of hardcoding /root. |
| src/docker-manager-cleanup.test.ts | Mocks getSafeHostUid/getSafeHostGid to return actual process uid/gid. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Overall: FAIL — pre-computed step outputs were not substituted into the prompt (GitHub Actions template variables
|
Smoke Test Results❌ GitHub API: Failed to list merged PRs (auth error: localhost endpoint unreachable) Result: FAIL (2/3 tests passed)
|
🧪 Smoke Test Results — Copilot Engine
Overall: PARTIAL — pre-agent step file confirms engine started, but MCP auth and template substitution issues prevent full validation.
|
Smoke Test CodexPRs: fix: postprocess claude-token-optimizer lock file to use local awf build; refactor: split api-proxy-service.test.ts into focused test modules Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Chroot Smoke Test Results
Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot.
|
Smoke Test Results — FAIL
|
|
Gemini Smoke Test Results:
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Fixes 4 test failures (in 2 suites) that occur on macOS due to platform differences:
docker-manager-utils.test.ts (2 failures)
Tests hardcoded
/rootas root's home directory, but macOS uses/var/root. Fixed by reading the actual root home from/etc/passwdat test time.docker-manager-cleanup.test.ts (2 failures)
writeConfigs()callschownSync(dir, uid, gid)wheregidcomes fromgetSafeHostGid(). On macOS, the real gid (501) is below 1000 and gets clamped to 1000, but the current user doesn't belong to gid 1000, causing EPERM. Fixed by mockinggetSafeHostUid/Gidin the test to return the actual process uid/gid.Note: The
workflow-engine-install-securityfailure (missing--ignore-scriptsin Claude Code installs) is a gh-aw compiler issue in generated lock files — not addressed here since lock files should not be edited directly.